package com.cxyd.modules.log.controller;

import com.cxyd.common.page.PageData;
import com.cxyd.common.utils.Result;
import com.cxyd.modules.log.service.SysLogOperationService;
import com.cxyd.modules.log.dto.SysLogOperationDTO;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;


/**
 * 操作日志
 */
@RestController
@RequestMapping("sys/log/operation")
public class SysLogOperationController {
    private final SysLogOperationService sysLogOperationService;

    public SysLogOperationController(SysLogOperationService sysLogOperationService) {
        this.sysLogOperationService = sysLogOperationService;
    }

    @GetMapping("page")
    @RequiresPermissions("sys:log:operation")
    public Result<PageData<SysLogOperationDTO>> page(@RequestParam Map<String, Object> params){
        PageData<SysLogOperationDTO> page = sysLogOperationService.page(params);

        return new Result<PageData<SysLogOperationDTO>>().ok(page);
    }
}